package cz.muni.fi.pa165.pokemon.dao;

import cz.muni.fi.pa165.pokemon.entity.Badge;
import java.util.List;

/**
 * Data Object Access interface for Badge entity.
 * Basic CRUD functionality methods for Badge database Badge operation.
 * 
 * @author Michal Toth
 */
public interface BadgeDAO {
    
    
    /**
     * Method creates new badge entity using parameter
     * badge of type Badge.
     * 
     * @param badge 
     * @throws IllegalArgumentException when badge or badge.id is null
     */
    void create(Badge badge);
    
    /**
     * Method finds badge in database using 
     * badge id.
     * 
     * @param id - unique identification Long number 
     * @throws IllegalArgumentException when id is null
     * @return badge 
     */
    Badge get(Long id);
    
    /**
     * Method updates given badge information in database.
     * 
     * @param badge - Badge type parameter to be updated
     * @throws IllegalArgumentException when badge or badge.id is null
     */
    void update(Badge badge);
    
    /**
     * Removes given badge from database.
     * 
     * @param badge - Badge type parameter to be removed
     * @throws IllegalArgumentException when badge or badge.id is null
     */
    void remove(Badge badge);
    
    /**
     * Method returns all badges from database.
     * 
     * @return List of all badges
     */
    List<Badge> findAll();
    
    
    /**
     * Method looks for given last and first name of badge in database
     * and returns collection of found badges with given name.
     * 
     * @param firstName given name of badge, lastName last name of badge
     * @throws IllegalArgumentException when firstName and lastName are both null
     * @return List of badges with given first and last name.
     */
    List<Badge> findByName(String firstName, String lastName);
    
}
